<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>
</head>
<body>
<button onclick="hh">asdas</button>
</body>
<script>
    function hh() {
        console.log("click");

        $.ajax({
            type: "GET",
            url: "http://localhost:9999/json",
            success: function (data) {
                console.log(data);
            },
            error: function (jqXHR) {
                console.log(jqXHR);
            }
        });
    }
</script>
</html>